
class Stack {
    constructor() {
        this.list = [];
    }
    put(data) {
        this.list.unshift(data);
        return this;
    }
    top() {
        return this.list[0];
    }
    pop() {
        return this.list.pop()
    }
    shift() {
        return this.list.shift()
    }
    peek() {
        return this.list[0];
    }
    size() {
        return this.list.length;
    }
    clear() {
        this.list = [];
        return this;
    }
}

export default Stack;
